home *** CD-ROM | disk | FTP | other *** search
- // mainfrm.cpp : implementation of the CMainFrame class
- //
- // This is a part of the Microsoft Foundation Classes C++ library.
- // Copyright (C) 1999 Microsoft Corporation
- // All rights reserved.
- //
- // This source code is only intended as a supplement to the
- // Microsoft Foundation Classes Reference and related
- // electronic documentation provided with the library.
- // See these sources for detailed information regarding the
- // Microsoft Foundation Classes product.
-
- #include "stdafx.h"
- #include "chatter.h"
-
- #include "mainfrm.h"
- #include "chatdoc.h"
- #include "chatvw.h"
- #include "sendvw.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
-
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
-
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code !
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
-
- CMainFrame::CMainFrame()
- {
- }
-
- CMainFrame::~CMainFrame()
- {
- }
-
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- #if (_WIN32_WCE > 200)
- if(!m_wndCommandBar.Create(this) ||
- !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) ||
- !m_wndCommandBar.AddAdornments())
- {
- TRACE0("Failed to create CommandBar\n");
- return -1; // fail to create
- }
- #else // MFC for Windows CE 1.0 and 2.0
- if(!AddAdornments(0))
- {
- TRACE0("Failed to create CommandBar\n");
- return -1; // fail to create
- }
- #endif
-
- return 0;
- }
-
- BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
- CCreateContext* pContext)
- {
- if (m_wndSplitter.CreateStatic(this,2,1))
- {
- CRect rect;
- GetClientRect(&rect);
- CSize size = rect.Size();
- size.cy-=150;
- if (m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CChatView),size,pContext))
- {
- if (m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CSendView),CSize(0,0),pContext))
- {
- SetActiveView((CView*)m_wndSplitter.GetPane(1,0));
- return TRUE;
- }
- }
- }
- return FALSE;
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
-
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
-
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
-
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
-
-